feat: warn when trip_headsign matches intermediate stop name#2139
feat: warn when trip_headsign matches intermediate stop name#2139PatrickSteil wants to merge 4 commits intoMobilityData:masterfrom
Conversation
|
Thanks for opening this pull request! You're awesome. We use semantic commit messages to streamline the release process. Before your pull request can be merged, you should update your pull request title to start with a semantic prefix. Examples of titles with semantic prefixes:
|
|
In this PR patrickbr/gtfstidy#41, i posted the same example but with a screenshot of the trip's route, as well as implementing a fix by overwriting the |
|
Thanks @PatrickSteil for this great rule addition! There are some cases where the trip headsign changes mid-trip. In this situation, the best practices recommend that feeds set trip.headsign to an intermediate stop and then override it using stop_times.stop_headsign for the later portion.
Due to this case, we'd like to proceed with downgrading this rule from a WARNING to INFO severity, since there are some cases where the trip_headsign matching an intermediate stop name is valid behavior. cc @tzujenchanmbd @skalexch |


Adds a new validation rule
TripHeadsignValidatorthat warns when a trip'strip_headsignmatches thestop_nameof an intermediate stop (i.e., any stop that is not the last stop of the trip). This can cause confusion for passengers boarding after that stop, as the headsign suggests the vehicle is heading somewhere it has already passed.The notice
TripHeadsignMatchesIntermediateStopNoticeis emitted as aWARNINGand includes:trip_idand its row number intrips.txttrip_headsignvaluestop_idandstop_sequenceof the intermediate stop matching thetrip_headsignstop_idof the actual last stop of the tripNoticeFieldsTesthas been updated to register a new notice field name introduced:tripHeadsign.Note that if a trip visits the last stop multiple times, then no warning is shown.
The following screenshot shows a real-world example of the official Swiss GTFS feed, where a trip passed through St. Gallen, and continues to Winterthur. But the
trip_headsignshowsSt. Gallen.